package com.isoftstone.service;

import com.github.pagehelper.Page;
import com.isoftstone.pojo.PaymentRecord;
import com.isoftstone.util.Result;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Optional;

public interface PaymentRecordService {
    Result<?> insertPaymentRecord(PaymentRecord paymentRecord);

    Result<?> deletePaymentRecord(Integer id);

    Result<?> updatePaymentRecord(Integer id, PaymentRecord paymentRecord);

    Optional<PaymentRecord> getPaymentRecordById(Integer id);

    Page getAllPaymentRecords(Integer currentPage, Integer pageSize);

    Page getPaymentRecordsByStudentId(String studentNumber,Integer currentPage, Integer pageSize);

    Page getPaymentRecordsByItemName(String ItemName, Integer currentPage, Integer pageSize);

    Page getPaymentRecordsByStatus(String status,Integer currentPage, Integer pageSize);

    Page getPaymentRecordsByPaymentMethod(String paymentMethod,Integer currentPage, Integer pageSize);

    //校验学号和缴费项目
    boolean checkPaymentRecord(String studentNumber, String itemName);


    @Transactional
    Result<?> pay(PaymentRecord dto);

    @Transactional
    Result<?> payAll(PaymentRecord dto);

    List<PaymentRecord> getUnpaidList(String studentNumber);
}
